package com.bjb.vr.common.config;

import com.github.yitter.contract.IdGeneratorOptions;
import com.github.yitter.idgen.YitIdHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @version 1.0.0
 * @author: HuJingBo
 * @time: 2022/6/13 10:09
 */
@Order(3)
@Slf4j
@Component
public class IdGeneratorStarter implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {
        IdGeneratorOptions options = new IdGeneratorOptions((short) 1);
        YitIdHelper.setIdGenerator(options);
    }
}
